package com.sk.bilibili.view.diy.bottomDialog;

import android.view.View;

import androidx.fragment.app.FragmentManager;

import com.sk.bilibili.R;
import com.sk.bilibili.model.diy.bottomDialog.DeleteModel;

public class DeleteBottomDialog extends BaseBottomDialog<DeleteModel>
        implements View.OnClickListener{

    private Integer targetId;

    public void show(FragmentManager fragmentManager, Integer targetId) {
        show(fragmentManager);
        this.targetId =targetId;
    }

    @Override
    public int getLayoutRes() {
        return R.layout.bottom_dialog_delete;
    }

    @Override
    protected int[] getClickIds() {
        return new int[]{R.id.tv_delete,R.id.tv_cancel};
    }

    @Override
    protected void onClick(int id) {
        if (id == R.id.tv_delete) {
            model.delete( targetId);
            toast("删除成功");
        }
        dismiss();
    }

}